<?php /* Smarty version Smarty-3.1.13, created on 2013-08-07 01:50:43
         compiled from "/var/www/html/templates/en/sms_group/create.tpl" */ ?>
<?php /*%%SmartyHeaderCode:15204448805201377339a1d0-96296942%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'cbdb495d659a52184607dc87d29e222e38cff20f' => 
    array (
      0 => '/var/www/html/templates/en/sms_group/create.tpl',
      1 => 1375809581,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '15204448805201377339a1d0-96296942',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'link_return' => 0,
    'msg' => 0,
    'action' => 0,
    'name' => 0,
    'list' => 0,
    'arrLists' => 0,
    'category' => 0,
    'key' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.13',
  'unifunc' => 'content_520137735238d0_30290513',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_520137735238d0_30290513')) {function content_520137735238d0_30290513($_smarty_tpl) {?>  
  <script>
  	var i = 0;
	function addElement()
	{
		var name = document.frmAdmin.phone.value;
		if(isBlank(name)) {
			alert('Please input the phone');
			return false;
		}
		if(!phonenumber(name)) {
			alert('The phone is invalid');
			return false;
		}		
		var para=document.createElement("div");
		para.setAttribute('id', i);
		//var node=document.createTextNode(name + '<a href="#" role="button" data-toggle="modal"><i class="icon-remove"></i></a>');
		//para.appendChild(node);
		para.innerHTML = name + ' <a href="#" role="button" data-toggle="modal" onClick="javascript:removeElement(\''+i+'\', \''+name+'\');"><i class="icon-remove"></i></a>';
		
		var element=document.getElementById("listPhone");
		element.appendChild(para);
		i = i + 1;
		document.frmAdmin.phone.value = '';		
		document.frmAdmin.list.value = document.frmAdmin.list.value + name + '\n';		
	}
	function removeElement(id, name)
	{
		var parent=document.getElementById("listPhone");
		var child=document.getElementById(id);
		parent.removeChild(child);
		var str=document.frmAdmin.list.value;
		document.frmAdmin.list.value=str.replace( name + "\n", "");
	}
	
	function phonenumber(inputtxt)  
	{  
	  var phoneno = /^\+?([0-9]{2})\)?[-. ]?([0-9]{4})[-. ]?([0-9]{4})$/; 
	  if((inputtxt.match(phoneno)))  
	  {  
		  return true;  
	  }  
	  else  
	  {  
			return false;  
	  }  
	}  	
	function isBlank(str) {
		return (!str || /^\s*$/.test(str));
	}	
  </script>
  

<!-- Content Area -->
<div class="dma-thumbnail">
    <div class="content">
            
        <div class="header">
            
            <h1 class="page-title">Create Group</h1>
        </div>
        
        <ul class="breadcrumb">
            <li><a href="#">Home</a> <span class="divider">/</span></li>
            <li><a href="<?php echo $_smarty_tpl->tpl_vars['link_return']->value;?>
">Group</a> <span class="divider">/</span></li>
            <li class="active">Create</li>
        </ul>        
		<?php if ($_smarty_tpl->tpl_vars['msg']->value){?>
        <div class="alert alert-success">
         <button class="close" data-dismiss="alert" type="button">×</button>
        <?php echo $_smarty_tpl->tpl_vars['msg']->value;?>
   
        </div>
        <?php }?>    
        <div class="container-fluid">
        	<form name="frmAdmin" action="<?php echo $_smarty_tpl->tpl_vars['action']->value;?>
" method="post">
            <div class="row-fluid">
                <div class="btn-toolbar">
                    <button class="btn btn-primary" type="button" onclick="javascript:document.frmAdmin.submit();"><i class="icon-save"></i> Save</button>
                    <a href="<?php echo $_smarty_tpl->tpl_vars['link_return']->value;?>
" data-toggle="modal" class="btn">Cancel</a>
                  <div class="btn-group">
                  </div>
                </div>
                <div class="well">
                    
                        <label>Name</label>
                        <input type="text" name="name" maxlength="100" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['name']->value, ENT_QUOTES, 'UTF-8', true);?>
" size="30">
                	
                </div>
				<div class="well">

                  <div class="filter-search">
                    <label>Phone:</label>
                    <div class="input-append">
                        <input type="text" name="phone" id="phone" value=""  title="phone" class="span2 search-query" />
                        <button type="button" class="btn" onclick="javascript:addElement();" >Add</button>
                    </div>                    
                  </div>
                  <input type="hidden" name="list" value="<?php echo $_smarty_tpl->tpl_vars['list']->value;?>
" />
                  <div>&nbsp;</div>
                  <div class="well">
					<div id="listPhone">
                        <?php if ($_smarty_tpl->tpl_vars['arrLists']->value){?>  
                        <?php  $_smarty_tpl->tpl_vars['category'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['category']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['arrLists']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['category']->key => $_smarty_tpl->tpl_vars['category']->value){
$_smarty_tpl->tpl_vars['category']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['category']->key;
?>
                            <?php if ($_smarty_tpl->tpl_vars['category']->value){?>
                        	<div id="<?php echo $_smarty_tpl->tpl_vars['key']->value;?>
"><?php echo $_smarty_tpl->tpl_vars['category']->value;?>
 <a href="#" role="button" data-toggle="modal" onClick="javascript:removeElement('<?php echo $_smarty_tpl->tpl_vars['key']->value;?>
', '<?php echo $_smarty_tpl->tpl_vars['category']->value;?>
');"><i class="icon-remove"></i></a></div>
                            <?php }?>
                        <?php } ?>
                        <?php }?></div>
				  </div>                                                           
                </div>                                                        
            </div>
            </form>
        </div>
    </div>
</div>

  <!-- end of element-box -->
  
  <noscript>
  Warning! JavaScript must be enabled for proper operation of the Administrator backend.
  </noscript>
<!-- end of content --><?php }} ?>